import { DefaultLayout, ParentLayout } from '@/layout'
import type { Route } from '@/layout/components'

export default {
  path: '/jindouGift',
  name: 'JindouGift',
  component: DefaultLayout,
  redirect: '/jindouGift/jdgGoodsManage',
  meta: {
    title: '金豆兑好礼',
    icon: 'menu-gift',
    roles: ['金豆兑好礼'],
    alwaysShow: true,
    sort: 8
  },
  children: [
    {
      path: 'jdgGoodsManage',
      name: 'JdgGoodsManage',
      component: () => import('@/views/jindouGift/jdgGoodsManage'),
      meta: { title: '商品管理', roles: ['兑好礼商品管理'] }
    },
    {
      path: 'jdgAddOrEditGoods',
      name: 'JdgAddOrEditGoods',
      component: () =>
        import('@/views/jindouGift/jdgGoodsManage/addOrEditGoods'),
      meta: { title: '商品', hidden: true }
    },
    {
      path: 'jdgEditGiftGoods',
      name: 'JdgEditGiftGoods',
      component: () =>
        import('@/views/jindouGift/jdgGoodsManage/editGiftGoods'),
      meta: { title: '编辑礼购商品', hidden: true }
    },
    {
      path: 'jdgExpressTemplete',
      name: 'JdgExpressTemplete',
      component: () => import('@/views/jindouGift/jdgExpressTemplete'),
      meta: { title: '运费模板', roles: ['运费模板'] }
    },

    {
      path: 'jdgOrderManage',
      name: 'JdgOrderManage',
      component: ParentLayout,
      redirect: '/jindouGift/jdgOrderManage/orderList',
      meta: { title: '订单管理', roles: ['兑好礼订单管理'] },
      children: [
        {
          path: 'jdgOrderList',
          name: 'JdgOrderList',
          component: () =>
            import('@/views/jindouGift/jdgOrderManage/orderList'),
          meta: { title: '订单列表', roles: ['兑好礼订单列表'] }
        },
        {
          path: 'jdgRefundOrderList',
          name: 'JdgRefundOrderList',
          component: () =>
            import('@/views/jindouGift/jdgOrderManage/refundOrderList'),
          meta: { title: '售后订单', roles: ['兑好礼售后订单'] }
        },
        {
          path: 'jdgOrderDetail',
          name: 'JdgOrderDetail',
          component: () =>
            import('@/views/jindouGift/jdgOrderManage/orderList/orderDetail'),
          meta: { title: '订单详情', hidden: true }
        }
      ]
    }
  ]
} as Route
